﻿<UserControl x:Name="userControl"
    x:Class="EString.Controls.MainMenu"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:EString.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="559"
    d:DesignWidth="92" HorizontalAlignment="Right" Margin="0" RenderTransformOrigin="0.5,0.5">
    
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ms-appx:///Symmetry/Themes/Generic.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <Style x:Key="CtxMenuButtonStyle" TargetType="Button">
                <Setter Property="Background" Value="#FF1F3B53" />
                <Setter Property="Foreground" Value="#FF000000" />
                <Setter Property="Padding" Value="3" />
                <Setter Property="BorderThickness" Value="1" />
                <Setter Property="BorderBrush">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFA3AEB9" Offset="0" />
                            <GradientStop Color="#FF8399A9" Offset="0.375" />
                            <GradientStop Color="#FF718597" Offset="0.375" />
                            <GradientStop Color="#FF617584" Offset="1" />
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Grid x:Name="grid" d:DesignWidth="163" d:DesignHeight="106" RenderTransformOrigin="1.008,0.483">
                            	<Grid.Projection>
                            		<PlaneProjection/>
                            	</Grid.Projection>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualStateGroup.Transitions>
                                            <VisualTransition GeneratedDuration="0:0:0.5">
                                        		<VisualTransition.GeneratedEasingFunction>
                                        			<BackEase EasingMode="EaseInOut"/>
                                        		</VisualTransition.GeneratedEasingFunction>
                                        	</VisualTransition>
                                        </VisualStateGroup.Transitions>
                                        <VisualState x:Name="Normal">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="mouseOverEffect" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="mouseOverEffect" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                                </DoubleAnimationUsingKeyFrames>
                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="mouseOverEffect" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                    <EasingColorKeyFrame KeyTime="00:00:00" Value="#FF383839" />
                                                </ColorAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Pressed">
                                            <Storyboard>
                                        		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="mouseOverEffect" Storyboard.TargetProperty="(UIElement.Opacity)">
                                        			<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.135" />
                                        		</DoubleAnimationUsingKeyFrames>
                                        		<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="grid">
                                        			<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="30"/>
                                        			<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
                                        		</DoubleAnimationUsingKeyFrames>
                                        		<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="grid">
                                        			<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                        			<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
                                        			<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/>
                                        		</DoubleAnimationUsingKeyFrames>
                                        	</Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="mouseOverEffect" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                    <EasingColorKeyFrame KeyTime="00:00:00" Value="#FF3F3F3F" />
                                                </ColorAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="mouseOverEffect" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="CheckStates">
                                        <VisualStateGroup.Transitions>
                                            <VisualTransition GeneratedDuration="0:0:0.5">
                                                <VisualTransition.GeneratedEasingFunction>
                                                    <ExponentialEase EasingMode="EaseIn" />
                                                </VisualTransition.GeneratedEasingFunction>
                                            </VisualTransition>
                                        </VisualStateGroup.Transitions>
                                        <VisualState x:Name="Checked">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="toggle2" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Unchecked" />
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="FocusStates">
                                        <VisualState x:Name="Focused" />
                                        <VisualState x:Name="Unfocused" />
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Border BorderThickness="0" Width="80" Height="80" />
                                <Rectangle x:Name="mouseOverEffect" StrokeThickness="1" Fill="#FFD1D1D1" Opacity="0" Width="80" Height="80" >
                                	<Rectangle.Projection>
                                		<PlaneProjection/>
                                	</Rectangle.Projection>
                                </Rectangle>
                                <TextBlock VerticalAlignment="Center" Text="{TemplateBinding Content}" TextWrapping="Wrap" Foreground="#FFFCFCF0" Margin="0" HorizontalAlignment="Center" FontFamily="Century"  FontSize="12" />
                                <Canvas x:Name="toggle2" HorizontalAlignment="Right" VerticalAlignment="Top" Width="23" Opacity="0" Margin="0,20,0,0">
                                    <Ellipse Fill="{StaticResource EStringOrange}" StrokeEndLineCap="Triangle" StrokeStartLineCap="Triangle" StrokeThickness="2" Height="8" Width="8" Canvas.Left="8" Canvas.Top="26" />
                                </Canvas>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Storyboard x:Name="Hide">
            	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="userControl">
            		<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
            		<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
            		<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="46"/>
            	</DoubleAnimationUsingKeyFrames>
            	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="userControl">
            		<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
            		<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
            		<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="90"/>
            	</DoubleAnimationUsingKeyFrames>
            	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="userControl">
            		<EasingDoubleKeyFrame KeyTime="0" Value="0.5"/>
            		<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
            		<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0.5"/>
            	</DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Name="Show">
            	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="userControl">
            		<EasingDoubleKeyFrame KeyTime="0" Value="101">
            			<EasingDoubleKeyFrame.EasingFunction>
            				<BackEase Amplitude="1"/>
            			</EasingDoubleKeyFrame.EasingFunction>
            		</EasingDoubleKeyFrame>
            		<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0">
            			<EasingDoubleKeyFrame.EasingFunction>
            				<BackEase/>
            			</EasingDoubleKeyFrame.EasingFunction>
            		</EasingDoubleKeyFrame>
            	</DoubleAnimationUsingKeyFrames>
            	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="userControl">
            		<EasingDoubleKeyFrame KeyTime="0" Value="90"/>
            		<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
            	</DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Style x:Key="ButtonStyle1" TargetType="Button">
            	<Setter Property="Background" Value="{StaticResource ButtonBackgroundThemeBrush}"/>
            	<Setter Property="Foreground" Value="{StaticResource ButtonForegroundThemeBrush}"/>
            	<Setter Property="BorderBrush" Value="{StaticResource ButtonBorderThemeBrush}"/>
            	<Setter Property="BorderThickness" Value="{StaticResource ButtonBorderThemeThickness}"/>
            	<Setter Property="Padding" Value="12,4,12,4"/>
            	<Setter Property="HorizontalAlignment" Value="Left"/>
            	<Setter Property="VerticalAlignment" Value="Center"/>
            	<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
            	<Setter Property="FontWeight" Value="SemiBold"/>
            	<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
            	<Setter Property="Template">
            		<Setter.Value>
            			<ControlTemplate TargetType="Button">
            				<Grid>
            					<VisualStateManager.VisualStateGroups>
            						<VisualStateGroup x:Name="CommonStates">
            							<VisualState x:Name="Normal"/>
            							<VisualState x:Name="PointerOver"/>
                                        <VisualState x:Name="Pressed"/>
                                        <VisualState x:Name="Disabled">
            								<Storyboard>
            									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Border">
            										<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonDisabledBackgroundThemeBrush}"/>
            									</ObjectAnimationUsingKeyFrames>
            									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Border">
            										<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonDisabledBorderThemeBrush}"/>
            									</ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
            							</VisualState>
            						</VisualStateGroup>
            						<VisualStateGroup x:Name="FocusStates">
            							<VisualState x:Name="Focused">
            								<Storyboard>
            									<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualWhite"/>
            									<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualBlack"/>
            								</Storyboard>
            							</VisualState>
            							<VisualState x:Name="Unfocused"/>
            							<VisualState x:Name="PointerFocused"/>
            						</VisualStateGroup>
            					</VisualStateManager.VisualStateGroups>
            					<Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Margin="3">
                                    <ContentPresenter x:Name="ContentPresenter" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Foreground="{TemplateBinding Foreground}"/>
            					</Border>
            					<Rectangle x:Name="FocusVisualWhite" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="1.5" StrokeEndLineCap="Square" Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}" StrokeDashArray="1,1"/>
            					<Rectangle x:Name="FocusVisualBlack" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="0.5" StrokeEndLineCap="Square" Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}" StrokeDashArray="1,1"/>
            				</Grid>
            			</ControlTemplate>
            		</Setter.Value>
            	</Setter>
            </Style>
            <Style x:Key="ButtonStyleCtxButton" TargetType="Button">
                <Setter Property="Background" Value="{StaticResource ButtonBackgroundThemeBrush}"/>
                <Setter Property="Foreground" Value="{StaticResource ButtonForegroundThemeBrush}"/>
                <Setter Property="BorderBrush" Value="{StaticResource ButtonBorderThemeBrush}"/>
                <Setter Property="BorderThickness" Value="{StaticResource ButtonBorderThemeThickness}"/>
                <Setter Property="Padding" Value="12,4,12,4"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
                <Setter Property="FontWeight" Value="SemiBold"/>
                <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Grid>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal"/>
                                        <VisualState x:Name="PointerOver">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Border">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonPointerOverBackgroundThemeBrush}"/>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonPointerOverForegroundThemeBrush}"/>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Pressed">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Border">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonPressedBackgroundThemeBrush}"/>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonPressedForegroundThemeBrush}"/>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Border">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonDisabledBackgroundThemeBrush}"/>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Border">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonDisabledBorderThemeBrush}"/>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonDisabledForegroundThemeBrush}"/>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="FocusStates">
                                        <VisualState x:Name="Focused">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualWhite"/>
                                                <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualBlack"/>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Unfocused"/>
                                        <VisualState x:Name="PointerFocused"/>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Margin="3">
                                    <TextBlock x:Name="ContentPresenter" Text="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}"/>
                                </Border>
                                <Rectangle x:Name="FocusVisualWhite" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="1.5" StrokeEndLineCap="Square" Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}" StrokeDashArray="1,1"/>
                                <Rectangle x:Name="FocusVisualBlack" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="0.5" StrokeEndLineCap="Square" Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}" StrokeDashArray="1,1"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
	<UserControl.Projection>
		<PlaneProjection/>
	</UserControl.Projection>
	<UserControl.RenderTransform>
		<CompositeTransform TranslateX="101"/>
	</UserControl.RenderTransform>
    <Grid x:Name="LayoutRoot" >
        <Button x:Name="MouseRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  Background="#7F1C1C1C" BorderBrush="{x:Null}" Padding="0" Style="{StaticResource ButtonStyle1}" IsHitTestVisible="False"/>
        <VariableSizedWrapGrid VerticalAlignment="Center" ItemWidth="153">
            <ToggleButton x:Name="btnNew" Content="Marquee" Height="60"
        		Command="{Binding DataContext.CmdToggleShouldShowMarquee, ElementName=userControl}"        		
        		IsChecked="{Binding DataContext.SymmetryInit.ShouldShowMarquee, ElementName=userControl, Mode=TwoWay}" 
        		ToolTipService.ToolTip="Creates a new instance of the target type using an empty constructor if available" 
        		Margin="5" BorderBrush="{x:Null}" FontSize="12" 
        		HorizontalAlignment="Stretch" />
            <ToggleButton x:Name="btnDragBoxes"
        		IsChecked="{Binding DataContext.SymmetryInit.ShouldShowMarqueeDragBoxes, ElementName=userControl, Mode=TwoWay}" 
        		Command="{Binding DataContext.CmdToggleShouldShowMarqueeDragBoxes, ElementName=userControl}"
        		Content="Drag Boxes" Height="60"  
        		ToolTipService.ToolTip="Sets the target content to its auto value if applicable" Margin="5" 
        		BorderBrush="{x:Null}" FontSize="12"  HorizontalAlignment="Stretch"/>
            <Button x:Name="btnVTG"  Command="{Binding DataContext.CmdShowImageStack, ElementName=userControl}"
        		Content="Visual Tree Graph" Height="60"  ToolTipService.ToolTip="Sets the target value to null if applicable" Margin="5" BorderBrush="{x:Null}" FontSize="12" Style="{StaticResource ButtonStyleCtxButton}" HorizontalAlignment="Stretch"/>
            <Button x:Name="btnPlugins" 
        		Command="{Binding DataContext.CmdShowPluginsCatalog, ElementName=userControl}"
        		Content="Plugins" Height="60" ToolTipService.ToolTip="Pins this editor for later use" Margin="5" BorderBrush="{x:Null}" FontSize="12" Style="{StaticResource ButtonStyleCtxButton}" HorizontalAlignment="Stretch"/>
            <Button x:Name="btnAbout"
        		Command="{Binding DataContext.CmdAbout, ElementName=userControl}"
        		Content="About" Height="60" ToolTipService.ToolTip="Launch the custom editor for this type" Margin="5" BorderBrush="{x:Null}" FontSize="12" Style="{StaticResource ButtonStyleCtxButton}" HorizontalAlignment="Stretch"/>
            <Button x:ConnectionId='1' x:Name="btnClose" Content="X" Height="60" ToolTipService.ToolTip="Launch the custom editor for this type" Margin="0,5"                        BorderBrush="{x:Null}" 
        		FontSize="12" Style="{StaticResource ButtonStyleCtxButton}" HorizontalAlignment="Stretch"/>
        </VariableSizedWrapGrid>
    </Grid>
</UserControl>

